/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUI;

import Model.CaseEvent;
import Model.CaseListener;

/**
 *
 * @author Snowangelic
 */
public class CaseView extends View implements CaseListener{

    int xIndex;
    int yIndex;
    Layer floorLayer;
    Layer itemLayer;
    Layer stoneLayer;

    CaseView(int xIndex,int yIndex,Layer floorLayer,Layer itemLayer,Layer stoneLayer){
        this.xIndex=xIndex;
        this.yIndex=yIndex;
        this.floorLayer=floorLayer;
        this.itemLayer=itemLayer;
        this.stoneLayer=stoneLayer;
    }
    public void floorChanged(CaseEvent e) {
        floorLayer.addLayerEvent(new LayerEvent(xIndex,yIndex,e.getSource().getFloorImage()));
    }

    public void stoneChanged(CaseEvent e) {
        stoneLayer.addLayerEvent(new LayerEvent(xIndex,yIndex,e.getSource().getStoneImage()));
    }

    public void itemChanged(CaseEvent e) {
       itemLayer.addLayerEvent(new LayerEvent(xIndex,yIndex,e.getSource().getItemImage()));
    }

}
